package Chap03;

public class Goods {
    private int id;
    private String name;
    private double price;
    private int  shortage;

    public Goods() {
    }

    public Goods(int id, String name, double price, int shortage) {
        this.id = id;
        this.name = name;
        this.price = price;
        this.shortage = shortage;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
        if(name.length()>8)
            System.out.println("没有此种水果");

    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public int getShortage() {
        return shortage;
    }

    public void setShortage(int shortage) {
        this.shortage = shortage;
    }
}
